how to solve arithmetic sequences